package xj.graph2d.graph;

import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import java.io.PrintWriter;
import java.util.Set;

public interface GraphNode <EdgeType extends GraphEdge>
  extends GraphComponent {

  public Point2D getULCorner(); // upper-left

  public Point2D getLRCorner(); // lower-right

  public Point2D getCenter();

  public void setLocation(Point2D p);

  public void setLocation(double x, double y);

  public Dimension2D getSize();

  public void setSize(double width, double height);

  public int isInside(Point2D p);

  public boolean isMovable();

  public void setMovable(boolean movable);

  public void move(double dx, double dy);

  public int getNodeType();

  public void setNodeType(int type);

  public int getCount();

  public void setCount(int count);

  public int getHeight();

  public void setHeight(int height);

  public int getRank();

  public void setRank(int rank);

  public Set<Connector> getConnectors();

  public void addConnector(Connector c);

  public void removeConnector(Connector c);

  public Set<EdgeType> leavingEdges();

  public Set<EdgeType> arrivingEdges();

  public int getDegree();

  public int getInDegree();

  public int getOutDegree();

  /**
   * Print the node description to the provided stream.
   * 
   * @param out
   *                the output text stream for writing the description.
   */
  public void printNode(PrintWriter out);

}
